package com.bbx.taxi.client.Task;

import android.app.Activity;
import android.util.Log;

import com.bbx.api.sdk.model.passanger.ActivityContentBuild;
import com.bbx.api.sdk.model.passanger.BalanceBuild;
import com.bbx.api.sdk.model.passanger.Return.Balance;
import com.bbx.api.sdk.net.base.BaseNetwork;
import com.bbx.api.sdk.net.passeger.conn.ActivityNet;
import com.bbx.api.sdk.net.passeger.conn.BalanceNet;
import com.bbx.taxi.client.Bean.Message.ObserverListener;
import com.bbx.taxi.client.Bean.Wallect;
import com.bbx.taxi.client.MyApplication;
import com.bbx.taxi.client.Util.VersionUtils;

/**
 * 作者：严旭文 on 2016/12/28 11:02
 * 邮箱：420255048@qq.com
 */
public class MyBalanceTask extends BaseTask{
    public ObserverListener.DATA_TYPE TYPE= ObserverListener.DATA_TYPE.BALANCE;
    BalanceBuild mBalanceBuild;
    public MyBalanceTask(Activity context) {
        super(context);
        mBalanceBuild = new BalanceBuild(context);
        mBalanceBuild.uid= MyApplication.getInstance().getUid();
        mBalanceBuild.access_token= MyApplication.getInstance().getToken();
    }
    @Override
    public boolean isShow() {
        return false;
    }
    @Override
    public boolean isReturnString() {
        return false;
    }
    @Override
    public boolean condition() {
        // TODO Auto-generated method stub
        return true;
    }
    public void request() {
        setType(TYPE,mBalanceBuild);
    }
    @Override
    public void success(int status,Object object) {
        try{
        Balance mBalance=(Balance)object;
        Wallect.accountBalance=mBalance.getAvailBlanck();
        }catch (Exception e){}

    }
    @Override
    public void failed(int status, String msg,String message) {
        // TODO Auto-generated method stub

    }
    @Override
    public BaseNetwork getBaseNetwork() {
        return new BalanceNet(context);
    }
}

